Skip to content

fix(docs): Handle malformed YAML frontmatter gracefully - #1268

Merged
TkDodo merged 1 commit into
mainfrom
seer/fix/malformed-yaml-frontmatter
Sep 13, 2026
Merged

fix(docs): Handle malformed YAML frontmatter gracefully#1268
TkDodo merged 1 commit into
mainfrom
seer/fix/malformed-yaml-frontmatter

Conversation

@sentry

@sentry sentry Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

This PR addresses an issue where malformed YAML frontmatter in remote documentation files would cause a YAMLParseError, leading to crashes during page loading and manifest generation.

The parseFrontMatter function in src/utils/documents.server.ts now includes a try/catch block around the parseYaml call. If a YAMLParseError occurs, it will log a warning to the console and return a fallback object { content: body, data: {} }. This ensures that the application can gracefully handle invalid frontmatter by serving the document's body content without metadata, preventing crashes and maintaining application stability. This approach is consistent with how parseFrontMatter already handles other cases of unusable frontmatter (e.g., missing delimiters).

Fixes TANSTACK-COM-50Z

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@sentry
sentry Bot requested a review from a team September 12, 2026 11:01
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 31ce0c7c-d34f-4c8b-91cc-34f1029a12b6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 8fe5533 Commit Preview URL

Branch Preview URL
Sep 12 2026, 11:03 AM

@TkDodo
TkDodo merged commit 5aeec04 into main Sep 13, 2026
7 checks passed
@TkDodo
TkDodo deleted the seer/fix/malformed-yaml-frontmatter branch September 13, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant